<?php
//DataObject interface.
//All Classes that act as "middle men" between the PHP system and the database should implement this
//DataObject Interface.

interface DataObject {
	//retrieveFromID() accepts an ID number as a parameter, and goes into the corresponding table in
	//the database. it pulls all the fields in the row that is returned for that ID, and fills the 
	//fields of the DataObject with the values of the database fields. It returns a boolean (true on
	//success, false on failure/no row found)
	public function retrieveFromID($id);
	
	//getLatest() updates all the variables inside the DataObject to reflect the most up to date values
	//from the database. It returns a boolean (true on success, false on failure)
	public function getLatest();
	
	//update() updates the row in the database that has an ID=$this->ID. It returns a boolean (true 
	//on success, false on failure)
	public function update();
	
	//insert() creates a new row in the database table containing the values from the instance 
	//variables for the object. It returns a boolean (true on success, false on failure).
	//NOTE: The auto-generated ID should be placed in $this->ID!!
	public function insert();
	
	//delete() removes the row from the database with an ID corresponding to $this->ID.
	//It returns a boolean (true on success, false on failure)
	public function delete();
}
?>
